package com.budwk.app.sqfw.models;

import com.budwk.app.sqfwV2.dto.vo.BuildingUnitVo;
import com.budwk.starter.common.openapi.annotation.ApiModel;
import com.budwk.starter.common.openapi.annotation.ApiModelProperty;
import lombok.Data;
import lombok.experimental.Accessors;
import org.nutz.dao.entity.annotation.*;
import org.nutz.dao.interceptor.annotation.PrevInsert;

import java.io.Serializable;
import java.math.BigDecimal;
import java.time.LocalDateTime;
import java.util.List;

@Data
@Accessors(chain = true)
@Table("shequ.sqfw_building_info")
@Comment("楼栋信息")
@ApiModel(description = "楼栋信息")
public class BuildingInfo implements Serializable {

    private static final long serialVersionUID = 1L;

    @Column
    @Name
    @Comment("编号")
    @ApiModelProperty(description = "ID")
    @ColDefine(type = ColType.VARCHAR, width = 32)
    @PrevInsert(els = {@EL("snowflake()")}, nullEffective = true)
    private String id;

    @Column("province")
    @Comment("省份")
    @ApiModelProperty(description = "省份")
    @ColDefine(type = ColType.VARCHAR, width = 50)
    private String province;

    @Column("city")
    @Comment("城市")
    @ApiModelProperty(description = "城市")
    @ColDefine(type = ColType.VARCHAR, width = 50)
    private String city;

    @Column("district")
    @Comment("区")
    @ApiModelProperty(description = "区")
    @ColDefine(type = ColType.VARCHAR, width = 50)
    private String district;

    @Column("county")
    @Comment("县")
    @ApiModelProperty(description = "县")
    @ColDefine(type = ColType.VARCHAR, width = 50)
    private String county;

    @Column("community")
    @Comment("社区")
    @ApiModelProperty(description = "社区")
    @ColDefine(type = ColType.VARCHAR, width = 50)
    private String community;

    @Column("courtyard")
    @Comment("院落")
    @ApiModelProperty(description = "院落")
    @ColDefine(type = ColType.VARCHAR, width = 50)
    private String courtyard;

    @Column("building_name")
    @Comment("楼栋名称")
    @ApiModelProperty(description = "楼栋名称")
    @ColDefine(type = ColType.VARCHAR, width = 50)
    private String buildingName;

    @Column("residential_area")
    @Comment("小区名称")
    @ApiModelProperty(description = "小区名称")
    @ColDefine(type = ColType.VARCHAR, width = 50)
    private String residentialArea;

    @Column("area")
    @Comment("建筑面积")
    @ApiModelProperty(description = "建筑面积")
    @ColDefine(type = ColType.DOUBLE, width = 50)
    private BigDecimal area;

    @Column("completion_year")
    @Comment("建成年份")
    @ApiModelProperty(description = "建成年份")
    @ColDefine(type = ColType.INT, width = 50)
    private Integer completionYear;

    @Column("completion_time")
    @Comment("建成时间")
    @ApiModelProperty(description = "建成时间")
    @ColDefine(type = ColType.DATETIME, width = 50)
    private LocalDateTime completionTime;

    @Column("building_use")
    @Comment("建筑用途")
    @ApiModelProperty(description = "建筑用途")
    @ColDefine(type = ColType.VARCHAR, width = 50)
    private String buildingUse;

    @Column("building_type")
    @Comment("建筑类型")
    @ApiModelProperty(description = "建筑类型")
    @ColDefine(type = ColType.VARCHAR, width = 50)
    private String buildingType;

    @Column("floors_count")
    @Comment("层数")
    @ApiModelProperty(description = "层数")
    @ColDefine(type = ColType.INT, width = 50)
    private Integer floorsCount;

    @Column("has_elevator")
    @Comment("是否有电梯")
    @ApiModelProperty(description = "是否有电梯")
    @ColDefine(type = ColType.VARCHAR, width = 50)
    private String hasElevator;

    @Column("households_count")
    @Comment("楼栋户数")
    @ApiModelProperty(description = "楼栋户数")
    @ColDefine(type = ColType.INT, width = 50)
    private Integer householdsCount;

    @Column("is_dilapidated")
    @Comment("是否危房")
    @ApiModelProperty(description = "是否危房")
    @ColDefine(type = ColType.VARCHAR, width = 50)
    private String isDilapidated;

    @Column("address")
    @Comment("所在地详址")
    @ApiModelProperty(description = "所在地详址")
    @ColDefine(type = ColType.VARCHAR, width = 50)
    private String address;

    @Column("detail_address")
    @Comment("详细地址")
    @ApiModelProperty(description = "详细地址")
    @ColDefine(type = ColType.VARCHAR, width = 300)
    private String detailAddress;

    @Column("unit_number")
    @Comment("单元数量")
    @ApiModelProperty(description = "单元数量")
    @ColDefine(type = ColType.INT, width = 300)
    private Integer unitNumber;

    @Column("coordinates")
    @Comment("坐标")
    @ApiModelProperty(description = "坐标")
    @ColDefine(type = ColType.VARCHAR, width = 50)
    private String coordinates;

    @Column("longitude")
    @Comment("经度")
    @ApiModelProperty(description = "经度")
    @ColDefine(type = ColType.VARCHAR, width = 50)
    private String longitude;

    @Column("latitude")
    @Comment("纬度")
    @ApiModelProperty(description = "纬度")
    @ColDefine(type = ColType.VARCHAR, width = 50)
    private String latitude;

    @Column("is_fill")
    @Comment("是否已采集房屋")
    @ApiModelProperty(description = "是否已采集房屋")
    @ColDefine(type = ColType.VARCHAR, width = 50)
    private String isFill;

    @Column("fill_num")
    @Comment("楼栋房屋采集数量")
    @ApiModelProperty(description = "楼栋房屋采集数量")
    @ColDefine(type = ColType.INT, width = 50)
    private Integer fillNum;

    @Column("fill_date")
    @Comment("数据采集时间")
    @ApiModelProperty(description = "数据采集时间")
    @ColDefine(type = ColType.DATETIME, width = 50)
    private LocalDateTime fillDate;


    @Column("create_by")
    @Comment("提交人")
    @ApiModelProperty(description = "提交人")
    @ColDefine(type = ColType.VARCHAR, width = 50)
    private String createBy;

    @Column("create_time")
    @Comment("提交时间")
    @ApiModelProperty(description = "提交时间")
    @ColDefine(type = ColType.DATETIME, width = 50)
    private LocalDateTime createTime;

    @Column("update_id")
    @Comment("修改人")
    @ApiModelProperty(description = "修改人")
    @ColDefine(type = ColType.VARCHAR, width = 50)
    private String updateId;

    @Column("update_time")
    @Comment("修改时间")
    @ApiModelProperty(description = "修改时间")
    @ColDefine(type = ColType.DATETIME, width = 50)
    private LocalDateTime updateTime;

    @Column("delete_reason")
    @Comment("删除原因")
    @ApiModelProperty(description = "删除原因")
    @ColDefine(type = ColType.VARCHAR, width = 300)
    private String deleteReason;

    @Column("grid")
    @Comment("网格")
    @ApiModelProperty(description = "网格")
    @ColDefine(type = ColType.VARCHAR, width = 300)
    private String grid;

    @Column("deleted")
    @Comment("是否删除")
    @ApiModelProperty(description = "是否删除")
    @ColDefine(type = ColType.BOOLEAN, width = 50)
    private boolean deleted;

    @Column("build_units")
    @Comment("楼栋单元信息")
    @ApiModelProperty(description = "楼栋单元信息")
    @ColDefine(type = ColType.TEXT, width = 300)
    private List<BuildingUnitVo> buildUnits;
}
